<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="address=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="browsermode" content="application" />
    <meta name="x5-page-mode" content="app" />
    <title>运营商认证</title>
    <meta charset="utf-8" />
    <link href="../css/main.css?rev=@@hash" rel="stylesheet" />
    <style>
    </style>
</head>
<body>
    <!-- 蒙版 -->
    <div class="layer_load">
        <div class="layer_mask"></div>
        <div class="layer_load_icon icon-loading"></div>
    </div>
    <!-- 脚本 -->
    <script src="../lib/zepto.min.js?rev=@@hash"></script>
    <script src="../js/main.js?rev=@@hash"></script>
    <script>
        !function (global, userUtil, layer) {

            var _sessionId = userUtil.userID();
            if (_sessionId && global.query) {

                var _mxcode = global.query['mxcode'];
                var _loginDone  = global.query['loginDone'];

                if(_mxcode == 1){   // 任务进行成功     
                    moxieSuccess();
                }else if(_mxcode == 2){    //任务进行中
                    
                    if(_loginDone){             //登录成功
                        moxieSuccess();
                    }else{                      //登录失败
                        moxieFail();
                    }

                }else{      
                        moxieFail();//其他情况
                }


                function moxieSuccess() {     //魔蝎认证成功
                    // layer.showLoad();
                    var confObj = {
                        url: global.localUrl + 'web/credit/addMoxieCompletion',
                        done: function(res){
                            window.location.href= global.localUrl+'trust/identification.html';
                        }
                    }
                    userUtil.ajax(confObj);
                };

                function moxieFail() {      //魔蝎认证失败
                   window.location.href= global.localUrl+ 'moxie/index.html#/carrier?apiKey='+global.moXieApiKey+'&userId='+userUtil.mobile()+'&showTitleBar=NO&themeColor=ff554e&showAgreement=NO&quitOnLoginDone=1&loginParams={"phone":"'+userUtil.mobile()+'","name":"'+userUtil.realName()+'","idcard":"'+userUtil.idCard()+'"}&backUrl='+global.localUrl+'trust/operateRes.html';
                };
         
            }

        }(global, userUtil, layer);

    </script>
</body>
</html>
